﻿using System;
using System.IO;
using UnityEngine;

// Token: 0x02000005 RID: 5
internal static class ProjectSpecificPlayerPrefs
{
	// Token: 0x0600000E RID: 14 RVA: 0x000090B4 File Offset: 0x000072B4
	private static string GetProjectUniqueKey(string key)
	{
		string name = new DirectoryInfo(Application.dataPath).Parent.Name;
		return name + "_" + key;
	}

	// Token: 0x0600000F RID: 15 RVA: 0x0000922C File Offset: 0x0000742C
	public static void SetInt(string key, int value)
	{
		string projectUniqueKey = ProjectSpecificPlayerPrefs.GetProjectUniqueKey(key);
		PlayerPrefs.SetInt(projectUniqueKey, value);
	}

	// Token: 0x06000010 RID: 16 RVA: 0x0000924C File Offset: 0x0000744C
	public static int GetInt(string key, int defaultValue = 0)
	{
		string projectUniqueKey = ProjectSpecificPlayerPrefs.GetProjectUniqueKey(key);
		return PlayerPrefs.GetInt(projectUniqueKey, defaultValue);
	}

	// Token: 0x06000011 RID: 17 RVA: 0x0000290E File Offset: 0x00000B0E
	public static void SetBool(string key, bool value)
	{
		ProjectSpecificPlayerPrefs.SetInt(key, value ? 1 : 0);
	}

	// Token: 0x06000012 RID: 18 RVA: 0x0000926C File Offset: 0x0000746C
	public static bool GetBool(string key, bool defaultValue = false)
	{
		return ProjectSpecificPlayerPrefs.GetInt(key, defaultValue ? 1 : 0) != 0;
	}

	// Token: 0x06000013 RID: 19 RVA: 0x00009290 File Offset: 0x00007490
	public static void SetString(string key, string value)
	{
		string projectUniqueKey = ProjectSpecificPlayerPrefs.GetProjectUniqueKey(key);
		PlayerPrefs.SetString(projectUniqueKey, value);
	}

	// Token: 0x06000014 RID: 20 RVA: 0x000092B0 File Offset: 0x000074B0
	public static string GetString(string key, string defaultValue = "")
	{
		string projectUniqueKey = ProjectSpecificPlayerPrefs.GetProjectUniqueKey(key);
		return PlayerPrefs.GetString(projectUniqueKey, defaultValue);
	}

	// Token: 0x06000015 RID: 21 RVA: 0x000092D0 File Offset: 0x000074D0
	public static void DeleteKey(string key)
	{
		string projectUniqueKey = ProjectSpecificPlayerPrefs.GetProjectUniqueKey(key);
		PlayerPrefs.DeleteKey(projectUniqueKey);
	}

	// Token: 0x06000016 RID: 22 RVA: 0x000092EC File Offset: 0x000074EC
	public static bool HasKey(string key)
	{
		string projectUniqueKey = ProjectSpecificPlayerPrefs.GetProjectUniqueKey(key);
		return PlayerPrefs.HasKey(projectUniqueKey);
	}

	// Token: 0x06000017 RID: 23 RVA: 0x0000930C File Offset: 0x0000750C
	public static void SetDateTime(string key, DateTime dateTime)
	{
		ProjectSpecificPlayerPrefs.SetString(key, dateTime.ToBinary().ToString());
	}

	// Token: 0x06000018 RID: 24 RVA: 0x00009330 File Offset: 0x00007530
	public static DateTime GetDateTime(string key, DateTime defaultValue = default(DateTime))
	{
		string @string = ProjectSpecificPlayerPrefs.GetString(key, string.Empty);
		bool flag = string.IsNullOrEmpty(@string);
		DateTime result;
		if (flag)
		{
			result = defaultValue;
		}
		else
		{
			long dateData = Convert.ToInt64(@string);
			DateTime dateTime = DateTime.FromBinary(dateData);
			result = dateTime;
		}
		return result;
	}
}
